Skip to content

Conversation

@JyotiBurnwal1
Copy link
Contributor

support to connect WS and save the trace to a file

Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much value in having two separate broken-up PRs for this functionality, so let's just close #285 in favor of this one. I've left several comments. Thanks for working on this!

package.json Outdated
"fs-extra": "^10.0.0",
"glob": "^7.2.0",
"natural-orderby": "^2.0.3",
"path": "^0.12.7",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path is already part of nodejs, so let's remove this as a dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private stopCB: (() => void) | null = null; // To store the stop callback
private selectedChannel: string = 'dev';

public async startTracing(fileUriPath: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not loving the if useWebsocket else logic througout this whole file. It makes each function more complex to read. It might be better to have two separate classes, something like PerfettoWebsocketClient and PerfettoEcpClient. They'd have a common interface with methods like enable, start, stop, saveToFile, or whatever else you'd need. Then your logic in here could be much simpler. You'd instantiate the correct one when we start, and then just to this.client.doTheTHing() in these methods below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created a single class "PerfettoManager"

@JyotiBurnwal1 JyotiBurnwal1 mentioned this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants